<?php

function __autoload($className){
    //如果是控制器,因为控制器类的名称倒数截取10个是Controller
    if(substr($className,-10) == 'Controller'){
        include "./Controller/{$className}.class.php";
    }else{//否则就是工具类
        include "./Tool/{$className}.class.php";
    }
}
$c = new IndexController();
$a = isset($_GET['a']) ? $_GET['a'] : 'index';
$c->$a();